import { ElNotification, ElMessageBox  } from 'element-plus'

// 无重叠消息通知框
let notificationInstance = null

export function notification(options) {
  if(notificationInstance) {
    notificationInstance.close()
  }

  notificationInstance = ElNotification(options)
}

// 退出登录框
export function messageReLogin() {
  return ElMessageBox.confirm('登录状态已过期，您可以继续留在该页面，或者重新登录', '系统提示', {
    confirmButtonText: '重新登录',
    cancelButtonText: '取消',
    type: 'warning'
  })
}